require('UIStoryboard,UMOnlineConfig,NSTimer');
require('NSArray');
defineClass('CCTabBarController', {
            loadCustomTabbar: function() {

            var sb = UIStoryboard.storyboardWithName_bundle("Main", null);
            var home = sb.instantiateViewControllerWithIdentifier("homevc");
            var videovc = sb.instantiateViewControllerWithIdentifier("videovc");
            var newsvc = sb.instantiateViewControllerWithIdentifier("newsvc");
            var morevc = sb.instantiateViewControllerWithIdentifier("morevc");

            self.setViewControllers([videovc, newsvc, morevc]);

            self.setTimer(NSTimer.scheduledTimerWithTimeInterval_target_selector_userInfo_repeats(1.0, self, "refreshTab", null, true));
            self.timer().fire();
            },
            refreshTab: function() {
            var home = self.getProp("home")
            var videovc = self.getProp("videovc")
            var newsvc = self.getProp("newsvc")
            var morevc = self.getProp("morevc")
            if (self.viewControllers().count() == 3) {
            var shenheTabSwitch = UMOnlineConfig.getConfigParams("sb_pingguoshenhe");
            if (shenheTabSwitch.isEqualToString("true") || shenheTabSwitch == null) {
            var array = NSArray.alloc().initWithObjects(videovc, newsvc, morevc, null);
            self.setViewControllers(array);
            } else {
            var array = NSArray.alloc().initWithObjects(home,videovc, newsvc, morevc, null);
            self.setViewControllers(array);
            }
            }
            if (self.viewControllers().count() == 4) {
            self.setSelectedIndex(0);
            self.timer().invalidate();
            }
            },
            });
